********************************************************************************
/* Data_Analysis.do: 

Performing the main  and supplementary analyses to show on paper 
 */

clear all 
macro drop _all
set linesize 200
set scheme s1mono

*set path folder where the data are stored
global DATA "C:\Users\franc\Desktop\POSTDOC_MILANO_STATALE\PROJECTS\ONGOING\RIPP_PAPER"

capture log close 
log using "$DATA\Data_Analysis", replace text

* Loading Dataset 
*use "$DATA\mainstreaming_far_right_lgbt_data.dta", clear
use "$DATA\RIPP_2nd_round_dataset.dta", clear

********************************************************************************
* Dependent variables: Anti-LGBTQI Speech elements
* TF
histogram ft_norm, normal 

* RW
histogram m_s_norm, normal 

* GTFS
histogram c_o_norm, normal 

********************************************************************************
* Independent variables
* Far-right political parties 
fre populist_farright
lab define populist_farright 0 "Other" 1 "Far-right"
lab val populist_farright populist_farright
catplot populist_farright, percent vertical

* Government status
fre gov_opp
lab define gov_opp 0 "Opposition" 1 "Incumbent"
lab val gov_opp gov_opp
catplot gov_opp, percent vertical

* Control variables 
* Legislature Fixed effects -- Speech level characteristic
encode session_legislature, gen(legislature)

* MPs gender -- MP level characteristic
encode genere, gen(gender)
replace gender = 2 if inlist(speaker_name_cognome, "BARTOLAZZI Armando", "BUBBICO Filippo", "DAVICO Michelino", "DE CRISTOFARO Giuseppe", "DE FILIPPO Vito")
replace gender = 2 if inlist(speaker_name_cognome, "DELLA VEDOVA Benedetto", "FERRI Cosimo Maria", "MERLO Ricardo Antonio", "PIZZA Giuseppe", "QUARTINI Andrea", "ROSSI-DORIA Marco", "VITO Elio")
replace gender = 1 if inlist(speaker_name_cognome, "BONETTI Elena", "D'ORSO Valentina", "DI MAGGIO Grazia", "FINOCCHIARO Anna", "GIANNINI Stefania", "GUERRA Maria Cecilia", "IDEM Josefa")	
fre gender

* MPs year of birth -- MP level characteristic
fre data_nascita
generate year_birth = real(substr(data_nascita, 1, 4))
* Assume you have a dataset with variable `speaker_name_cognome`
replace year_birth = 1969 if speaker_name_cognome == "ACCOTO Rossella"
replace year_birth = 1961 if speaker_name_cognome == "BARTOLAZZI Armando"
replace year_birth = 1954 if speaker_name_cognome == "BUBBICO Filippo"
replace year_birth = 1961 if speaker_name_cognome == "DAVICO Michelino"
replace year_birth = 1971 if speaker_name_cognome == "DE CRISTOFARO Giuseppe"
replace year_birth = 1963 if speaker_name_cognome == "DE FILIPPO Vito"
replace year_birth = 1948 if speaker_name_cognome == "DE VINCENTI Claudio"
replace year_birth = 1962 if speaker_name_cognome == "DELLA VEDOVA Benedetto"
replace year_birth = 1971 if speaker_name_cognome == "FERRI Cosimo Maria"
replace year_birth = 1955 if speaker_name_cognome == "FINOCCHIARO Anna"
replace year_birth = 1960 if speaker_name_cognome == "GIANNINI Stefania"
replace year_birth = 1957 if speaker_name_cognome == "GUERRA Maria Cecilia"
replace year_birth = 1964 if speaker_name_cognome == "IDEM Josefa"
replace year_birth = 1962 if speaker_name_cognome == "MERLO Ricardo Antonio"
replace year_birth = 1963 if speaker_name_cognome == "PIANTEDOSI Matteo"
replace year_birth = 1947 if speaker_name_cognome == "PIZZA Giuseppe"
replace year_birth = 1954 if speaker_name_cognome == "ROSSI-DORIA Marco"
fre year_birth

// Create 10-year cohort categories -- MP level characteristic
recode year_birth (1930/1939=1 "1930-1939") (1940/1949=2 "1940-1949") (1950/1959=3 "1950-1959") ///
                 (1960/1969=4 "1960-1969") (1970/1979=5 "1970-1979") (1980/1989=6 "1980-1989") ///
                 (1990/1999=7 "1990-1999"), generate(cohort_10yrs)
label var cohort_10yrs "10-Year Cohorts"
fre cohort_10yrs

// Create generational categories -- MP level characteristic
recode year_birth (1928/1945=1 "Silent Generation") (1946/1964=2 "Baby Boomers") ///
                 (1965/1980=3 "Generation X") (1981/1996=4 "Millennials") (1997/2012=5 "Generation Z"), generate(generation)
label var generation "Generational Categories"
fre generation

* Debate lenght (N MP speeches for a parliamentary debate topic) -- Speech level characteristic
bysort dibattito_id: gen speeches_count = _N
fre speeches_count

* Average speech lenght of MPs -- MPs level characteristic 
bysort id: egen sentences_per_speech = count(id)
bysort speaker_name_cognome: egen avg_sentences_per_mp = mean(sentences_per_speech)
fre avg_sentences_per_mp

* Emotional temperature of MPs -- MP level characteristic 
bysort speaker_name_cognome: egen avg_mp_anger = mean(anger)
fre avg_mp_anger

* Creating subset variable to exclude cases where N is less than 5. 
// Count the number of observations per speaker
bysort id : egen group_size = count(id)
// Create a dummy variable indicating if group size is less than 5
gen small_group = group_size < 5


* Initial means test for presence of Anti-LGBTQI discourses between far-right parties vs anything else
ttest ft_norm, by(populist_farright) unequal
ttest m_s_norm, by(populist_farright) unequal
ttest c_o_norm, by(populist_farright) unequal

********************************************************************************
********************************************************************************
* Multilevel Analysis (Preliminary, replicating the OLS analysis already done)
* Hierarchical structure: Sentence <--- Parliamentary Speech <---- MP (Three level structure)
* Sentence = DVs
* Parliamentary Speech = id
* MP = speaker_name_cognome

* Intercept only model: To what extent DVs vary across clusters?
* TF
mixed ft_norm || speaker_name_cognome:  || id: if small_group==0
est store m0a
estat icc 

* RW
mixed m_s_norm || speaker_name_cognome:  || id:  if small_group==0
est store m0b
estat icc 

* GTFS	
mixed c_o_norm || speaker_name_cognome:  || id:  if small_group==0
est store m0c
estat icc 

esttab m0a m0b m0c, b(%9,3f) se(%9,2f) aic bic label star(+ 0.10 * 0.05 ** 0.01 *** 0.001) 

********************************************************************************
* Independent variables model 1: Does the far-right significantly adopt more anti-LGBTQI speeches compared to others? And does government status exert an effect?
* TF
mixed ft_norm i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m1a
di ((.0006813-.0004233)/.0006813)*100 // 37.86%
di ((.0010753-.0010773)/.0010753)*100 // -0.186%

* RW
mixed m_s_norm i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger|| speaker_name_cognome:  || id: if small_group==0
est store m1b
di ((.0007671-.0004501)/.0007671)*100 // 41.32%
di ((.0018631-.0017607)/.0018631)*100 // 5.50%

* GTFS
mixed c_o_norm i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m1c
di ((.0009673-.0003169)/.0009673)*100 // 67.23%
di ((.0015186-.0015005)/.0015186)*100 // 1.19%


esttab m1a m1b m1c, b(%9,3f) se(%9,2f) aic bic label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

* Testing Interaction effect: Does being part of the goverment exert an effect in adopting anti-lgbtqi stances?
* TF
mixed ft_norm i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m2a
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)
di ((.0006813-.0004153)/.0006813)*100 // 39.04%
di ((.0010753-.0010816)/.0010753)*100 // -0.585%

* RW
mixed m_s_norm i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m2b
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)
di ((.0007671-.0004386)/.0007671)*100 // 42.82%
di ((.0018631-.0017683)/.0018631)*100 // 5.08%

* GTFS
mixed c_o_norm i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m2c
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)
di ((.0009673-.0003045)/.0009673)*100 // 68.52%
di ((.0015186-.0015073)/.0015186)*100 // 0.74%

esttab m2a m2b m2c, b(%9,3f) se(%9,2f) aic bic label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

* In no case being at the government yields any significant difference in adopting an anti-lgbt discourse for the far-right

* Overall table on presence of Anti-LGBTQI narratives
esttab m1a m2a m1b m2b m1c m2c, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

coefplot (m2a, label("Model 2 - TF") msymbol(circle) mcolor(gs12) msize(1.3) ciopts(col(gs12)lwidth(0.3)) ) ///
(m2b, label("Model 4 - RW") msymbol(triangle) mcolor(gs9) msize(1.3) ciopts(col(gs9)lwidth(0.3))) ///
(m2c, label("Model 6 - GTFS") msymbol(square) mcolor(gs6) msize(1.4) ciopts(col(gs6)lwidth(0.3))) , ///
 xlabel(-0.06 (0.01) 0.06, grid) xline(0, lwidth(0.3)) horizontal keep(*populist_farright *gov_opp i.populist_farright##i.gov_opp) xtitle("Coefficient estimates and 95% CIs") legend(title("", size (3.5))col(3)) 


* Creating the evergreen variables  --- Revise the thresholds to 0,5
* TF
gen dummy_evergreen_ft=.
replace dummy_evergreen_ft=1 if ft_norm>0.6
replace dummy_evergreen_ft=0 if ft_norm<0.6
fre dummy_evergreen_ft

* Empty model 
mixed lss2 || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft==1
estat icc
* About 12% of variance due to the speech level
* About 12% of variance is due to the MP level 

* Replicating Model 1 table 3
mixed lss2 i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft==1
est store m11a
di ((.087788-.0690385)/.087788)*100 // 21.36%
di ((.0867573-.0841957)/.0867573)*100 // 2.95%

* Replicating Model 2 table 3
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft==1
est store m11b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap)  yline(0) title("Evergreen TFN (> 0.6)") legend(off) name(sentiment_1, replace)
di ((.087788-.0705207)/.087788)*100 // 19.66%
di ((.0867573-.081798)/.0867573)*100 // 5.72%

* RW
gen dummy_evergreen_m_s=.
replace dummy_evergreen_m_s=1 if m_s_norm>0.6
replace dummy_evergreen_m_s=0 if m_s_norm<0.6
fre dummy_evergreen_m_s

mixed lss2 || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s==1
estat icc
* About 12% of variance due to the speech level
* About 12% of variance is due to the MP level 

* Replicating Model 1 table 3
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_m_s i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s==1
est store m22a
di ((.0878811-.0696472)/.0878811)*100 // 20.74%
di ((.0695986-.0707462)/.0695986)*100 // -1.64%

* Replicating Model 2 table 3
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s==1
est store m22b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off) title("Evergreen ASMN (> 0.6)") name(sentiment_2, replace)
di ((.0878811-.0707363)/.0878811)*100 // 19.50%
di ((.0695986-.0687152)/.0695986)*100 // 1.26%

* GTFS
gen dummy_evergreen_c_o=.
replace dummy_evergreen_c_o=1 if c_o_norm>0.6
replace dummy_evergreen_c_o=0 if c_o_norm<0.6
fre dummy_evergreen_c_o

mixed lss2 || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o==1
estat icc
* About 12% of variance due to the speech level
* About 12% of variance is due to the MP level 

* Replicating Model 1 table 3
mixed lss2 i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o==1
est store m33a
di ((.088966-.0598564)/.088966)*100 // 32.71%
di ((.0768443-.0753992)/.0768443)*100 // 1.88%

* Replicating Model 2 table 3
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o==1
est store m33b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off) title("Evergreen AGTN (> 0.6)") name(sentiment_3, replace)
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(title("", size (3.5))col(1) position(3)) title("") name(legend_only, replace)
di ((.088966-.0593445)/.088966)*100 // 33.29%
di ((.0768443-.0740528)/.0768443)*100 // 3.63%

graph combine sentiment_1 sentiment_2 sentiment_3 legend_only, ycommon col(2) commonscheme 

* Overall table on Anti-LGBTQI narratives and Sentiment analysis 
esttab m11a m11b m22a m22b m33a m33b, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

********************************************************************************
********************************************************************************

********************************************************************************
********************************************************************************
* Robustness Checks 
* Using different DVs for first step of analyses 
********************************************************************************
* Independent variables model 1: Does the far-right significantly adopt more anti-LGBTQI speeches compared to others? And does government status exert an effect?
* TF
mixed ft_ddr_pt_norm2 i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m1a

* RW
mixed m_s_ddr_pt_norm2 i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger|| speaker_name_cognome:  || id: if small_group==0
est store m1b

* GTFS
mixed c_o_ddr_pt_norm2 i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m1c

* Testing Interaction effect: Does being part of the goverment exert an effect in adopting anti-lgbtqi stances?
* TF
mixed ft_ddr_pt_norm2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m2a
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)

* RW 
mixed m_s_ddr_pt_norm2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m2b
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)

* GTFS
mixed c_o_ddr_pt_norm2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0
est store m2c
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)

* No substantial variation from main results.
* Overall table on presence of Anti-LGBTQI narratives
esttab m1a m2a m1b m2b m1c m2c, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


********************************************************************************
* Repeating analyses on whole sample instead of subset *************************
* Independent variables model 1: Does the far-right significantly adopt more anti-LGBTQI speeches compared to others? And does government status exert an effect?
* TF
mixed ft_norm i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: 
est store m1a

* RW
mixed m_s_norm i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger|| speaker_name_cognome:  || id: 
est store m1b

* GTFS
mixed c_o_norm i.populist_farright i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: 
est store m1c

* Testing Interaction effect: Does being part of the goverment exert an effect in adopting anti-lgbtqi stances?
* TF
mixed ft_norm i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: 
est store m2a
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)

* RW
mixed m_s_norm i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: 
est store m2b
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)

* GTFS
mixed c_o_norm i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id:
est store m2c
margins, at(gov_opp=(0 1) populist_farright=(0 1)) atmeans post 
marginsplot, recast(line) recastci(rarea) yline(0)

* No substantial variation from main results.
* Overall table on presence of Anti-LGBTQI narratives
esttab m1a m2a m1b m2b m1c m2c, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


* TF
* Replicating Model 1 table 3
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if dummy_evergreen_ft==1
est store m11a

* Replicating Model 2 table 3
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if dummy_evergreen_ft==1
est store m11b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen TFN (> 0.6)")

* RW
* Replicating Model 1 table 3
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_m_s i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if dummy_evergreen_m_s==1
est store m22a

* Replicating Model 2 table 3
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if dummy_evergreen_m_s==1
est store m22b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen Surrogate Maternity (> 0.6)")

* GTFS
* Replicating Model 1 table 3
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_c_o i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if dummy_evergreen_c_o==1
est store m33a

* Replicating Model 2 table 3
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if dummy_evergreen_c_o==1
est store m33b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen Hate Crimes (> 0.6)")

* Very little substantial differences, two out of three results significant at the 10% level. But anyway main results are stronger test given that this sample includes cases with issues of sparsity. 

* Overall table on Anti-LGBTQI narratives and Sentiment analysis 
esttab m11a m11b m22a m22b m33a m33b, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


********************************************************************************
* Repeating second part of analyses with different thresholds for establishing evergreens ****
* TF
gen dummy_evergreen_ft_2=.
replace dummy_evergreen_ft_2=1 if ft_norm>0.5
replace dummy_evergreen_ft_2=0 if ft_norm<0.5
fre dummy_evergreen_ft_2

gen dummy_evergreen_ft_3=.
replace dummy_evergreen_ft_3=1 if ft_norm>0.4
replace dummy_evergreen_ft_3=0 if ft_norm<0.4
fre dummy_evergreen_ft_3

gen dummy_evergreen_ft_4=.
replace dummy_evergreen_ft_4=1 if ft_norm>0.3
replace dummy_evergreen_ft_4=0 if ft_norm<0.3
fre dummy_evergreen_ft_4

mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft_2==1
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft_3==1
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft_4==1

mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft_2==1
est store m111b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen TFN (> 0.5)") name(thresh_5, replace)
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft_3==1
est store m111bb
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen TFN (> 0.4)") name(thresh_4, replace)
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_ft_4==1
est store m111bbb
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen TFN (> 0.3)") name(thresh_3, replace)

graph combine thresh_5 thresh_4 thresh_3, ycommon col(3)

* Overall table on Anti-LGBTQI narratives and Sentiment analysis 
esttab m111b m111bb m111bbb, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

* RW
gen dummy_evergreen_m_s_2=.
replace dummy_evergreen_m_s_2=1 if m_s_norm>0.5
replace dummy_evergreen_m_s_2=0 if m_s_norm<0.5
fre dummy_evergreen_m_s_2
gen dummy_evergreen_m_s_3=.
replace dummy_evergreen_m_s_3=1 if m_s_norm>0.4
replace dummy_evergreen_m_s_3=0 if m_s_norm<0.4
fre dummy_evergreen_m_s_3
gen dummy_evergreen_m_s_4=.
replace dummy_evergreen_m_s_4=1 if m_s_norm>0.3
replace dummy_evergreen_m_s_4=0 if m_s_norm<0.3
fre dummy_evergreen_m_s_4

mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s_2==1
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s_3==1
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s_4==1

mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s_2==1
est store m222b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen ASMN (> 0.5)") name(thresh_5, replace)
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s_3==1
est store m222bb
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen ASMN (> 0.4)") name(thresh_4, replace)
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_m_s_4==1
est store m222bbb
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen ASMN (> 0.3)") name(thresh_3, replace)

graph combine thresh_5 thresh_4 thresh_3, ycommon col(3)

* Overall table on Anti-LGBTQI narratives and Sentiment analysis 
esttab m222b m222bb m222bbb, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)

* GTFS
gen dummy_evergreen_c_o_2=.
replace dummy_evergreen_c_o_2=1 if c_o_norm>0.5
replace dummy_evergreen_c_o_2=0 if c_o_norm<0.5
fre dummy_evergreen_c_o_2
gen dummy_evergreen_c_o_3=.
replace dummy_evergreen_c_o_3=1 if c_o_norm>0.4
replace dummy_evergreen_c_o_3=0 if c_o_norm<0.4
fre dummy_evergreen_c_o_3
gen dummy_evergreen_c_o_4=.
replace dummy_evergreen_c_o_4=1 if c_o_norm>0.3
replace dummy_evergreen_c_o_4=0 if c_o_norm<0.3
fre dummy_evergreen_c_o_4

mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o_2==1
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o_3==1
mixed lss2 i.populist_farright i.gov_opp i.dummy_evergreen_ft i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o_4==1

mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o_2==1
est store m333b
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen AGTN (> 0.5)") name(thresh_5, replace)
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o_3==1
est store m333bb
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen AGTN (> 0.4)") name(thresh_4, replace)
mixed lss2 i.populist_farright##i.gov_opp i.legislature i.gender ib2.generation speeches_count avg_sentences_per_mp avg_mp_anger || speaker_name_cognome:  || id: if small_group==0 & dummy_evergreen_c_o_4==1
est store m333bbb
margins, at(populist_farright=(0 1) gov_opp=(0 1) ) atmeans post 
marginsplot, recast(scatter) recastci(rcap) yline(0) legend(off)  title("Evergreen AGTN (> 0.3)") name(thresh_3, replace)

graph combine thresh_5 thresh_4 thresh_3, ycommon col(3)

* No substantial differences for larger subsets
* Overall table on Anti-LGBTQI narratives and Sentiment analysis 
esttab m333b m333bb m333bbb, b(%9,3f) se(%9,2f) label star(+ 0.10 * 0.05 ** 0.01 *** 0.001)


log close 


































